package com.vineetmanohar.maventwitter;

import twitter4j.RateLimitStatus;

/**
 * Exception to indicate that the twitter hourly quota has been exhausted
 * 
 * @author Vineet Manohar
 */
public class TwitterHourlyQuotaExhausted extends Exception {
	private static final long serialVersionUID = 1L;

	private RateLimitStatus rateLimitStatus;

	public RateLimitStatus getRateLimitStatus() {
		return rateLimitStatus;
	}

	public TwitterHourlyQuotaExhausted(RateLimitStatus rateLimitStatus) {
		super("Twitter hourly quota of " + rateLimitStatus.getHourlyLimit()
				+ " exhausted. Try after " + rateLimitStatus.getResetTime());
		this.rateLimitStatus = rateLimitStatus;
	}
}
